package edu.nf.ch05;

import edu.nf.ch05.entity.User;
import edu.nf.ch05.service.UserService;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author wangl
 * @date 2025/4/23
 */
public class Main {

    public static void main(String[] args) {
        UserService service = new UserService();
        Map<String, Object> params = new HashMap<>();
        //params.put("name", "user1");
        List<User> list = service.listUsers(params);
        list.forEach(user -> {
            System.out.println(user.getId());
            System.out.println(user.getName());
            System.out.println(user.getAge());
        });


        List<Integer> ids = Arrays.asList(1, 2, 3);
        list = service.listUsersById(ids);

        User user = new User();
        user.setId(1);
        user.setName("xxx");
        service.update(user);

    }
}